Document IsFromUnhandledException/IsFromTerminalException API (.NET)#18676
Merged
jamescrosswell merged 5 commits intoJul 10, 2026
Merged
Conversation
Adds a subsection under the .NET before-send filtering docs covering the new SentryEvent extension methods introduced in sentry-dotnet#5177, with C# and F# examples showing how to filter by handled/unhandled/terminal status. Closes getsentry/sentry-dotnet#5348 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jamescrosswell
commented
Jul 9, 2026
jamescrosswell
commented
Jul 9, 2026
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Flash0ver
approved these changes
Jul 9, 2026
Comment on lines
+54
to
+55
| open Sentry | ||
| open System.Net.Http |
Member
There was a problem hiding this comment.
TIL: F# has no implicit usings / opens
Rename the before-send callback parameter from `event` to `sentryEvent` in the F# sample. This matches the C# sample and the new unhandled- exception example, and avoids `event`, which is reserved as a keyword for future expansion of F#. Refs GH-5348 Co-Authored-By: Claude <noreply@anthropic.com>
| } | ||
|
|
||
| // Drop noisy handled exceptions | ||
| if (sentryEvent.Exception is HttpRequestException) |
Contributor
There was a problem hiding this comment.
Bug: The C# code example uses HttpRequestException but is missing the required using System.Net.Http; directive, which will cause compilation errors for some users copying the code.
Severity: LOW
Suggested Fix
Add the using System.Net.Http; directive at the top of the C# code block to ensure the example compiles correctly for all users, regardless of their project's implicit using settings.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: docs/platforms/dotnet/common/configuration/filtering.mdx#L44
Potential issue: The C# code example in the documentation uses `HttpRequestException`
without including the necessary `using System.Net.Http;` directive. While projects using
.NET 6+ with implicit usings enabled will compile this code, it will fail for users on
other platforms like .NET Framework, older .NET Core versions, or Unity. This creates a
poor user experience as copied code will not work out-of-the-box. The corresponding F#
example correctly includes its equivalent import (`open System.Net.Http`), suggesting
this was an unintentional omission.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DESCRIBE YOUR PR
Documents the new
SentryEvent.IsFromUnhandledException()andSentryEvent.IsFromTerminalException()extension methods (added in getsentry/sentry-dotnet#5177) so users can find them where they're most likely to be used — thebefore-sendfiltering docs.Closes getsentry/sentry-dotnet#5348
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
sentry-dotnet v6.7.0SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: